home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / SPRINTF.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  321 b   |  13 lines

  1. /* sprintf.c --- p 467 */
  2. #include <stdio.h>
  3. int i     = 100;
  4. double x  = 1.23456;
  5. main()
  6. {
  7.     int numout;
  8.     char outbuf[81];
  9.     numout = sprintf(outbuf, "The value of i = %d and the value "
  10.                             "of x = %g\n", i, x);
  11.     printf("sprintf wrote %d characters and the buffer contains:\n%s",
  12.                             numout, outbuf);
  13. }